<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>个人中心</title>

	<link rel="stylesheet" href="/dist/css/bootstrap.min.css">
	<script src="/dist/js/jquery.min.js"></script>
	<script src="/dist/js/bootstrap.min.js"></script>
	<script src="/dist/js/holder.min.js"></script>
	<script src="/dist/js/application.min.js"></script>

	<style>
	li {
		list-style:none;
	}
	/*li span {
		top:20px;
	}*/

	</style>
</head>
<body>
      @include('/home/menu')
	<div class="container zero">
	    <div class="col-md-offset-1 ">
			  <ul class="nav nav-tabs" role="tablist">
				  <li role="presentation" ><a href="/people/setting">基本信息</a></li>
				  <li role="presentation" class="active"><a href="#">账号和密码</a></li>
				  <li role="presentation"><a href="#">消息和邮件</a></li>
				  <li role="presentation"><a href="#">屏蔽</a></li>
				  <li role="presentation"><a href="#">实验室</a></li>
				  <li role="presentation"><a href="#">有待开发</a></li>
			  </ul>
		</div>

			   
	        <div class="col-md-offset-1">
				<div class="list-group col-xs-10 col-sm-9 col-md-8 col-lg-7">
					  <a href="#" class="list-group-item active">
					    绑定手机和邮箱，并设置密码，帐号更安全。
					  </a>
						<a href="#" class="list-group-item">
							<span >手机:</span>
						  	<span>{{$ress->phone}}&nbsp;&nbsp;&nbsp;</span>
						  	
						</a>
						<a href="#" class="list-group-item">
							 <span >邮箱:</span>
						  	<span id='email'>{{$ress->email}}</span>
						  	
						</a>
				      <a href="#" class="list-group-item">
						  	<span >密码:</span>&nbsp;&nbsp;&nbsp;
			  			  	<!-- <span>{{$ress->phone}}&nbsp;&nbsp;&nbsp;</span> -->
			  			  	<span>
			  			  		<!-- Button trigger modal -->
								<button type="button" class="btn btn-primary btn-xs" data-toggle="modal" data-target="#myModal" >
								  修改密码
								</button>
										<!-- Modal -->
									<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
									  <div class="modal-dialog">
										    <div class="modal-content">
												<div class="modal-header btn-primary ">
													<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
													<h4 class="modal-title" id="myModalLabel">验证身份</h4>
												</div>

												<div class="modal-body">
												    <span>为了保证你的帐号安全，请验证身份。验证成功后进行下一步操作。</span> 
												        <div class="col-md-offset-2 " role="tablist">
														        <select name="email"  >
														        	<!-- <option value="1" selected>使用手机{{$ress->phone}}验证</option> -->
														        	<option value="{{$ress->email}}" >使用邮箱{{$ress->email}}验证</option>
														        </select>&nbsp;&nbsp;&nbsp;
														        <button class="btn btn-link" type="button" id="svcode">发送验证码</button><br><br>
															         <form class="form-inline" role="form">
																		  &nbsp;<div class="form-group">
																				    <label class="sr-only" for="exampleInputEmail2">Email address</label>
																				    <input type="email" class="form-control" id="exampleInputEmail2" placeholder="请输入邮箱内6位验证码" name="vcode">
																				</div>
																				  {{ csrf_field() }}
																             <input type="submit" class="btn btn-primary" value="验证" name="submit">
															          </form>
															          @if(session('error'))
															         {{session('error')}} 
															          @endif
												        </div>
												</div>
												<div class="modal-footer  ">
												验证身份遇到问题？你可以发邮件至
												zheye@lnmp.space联系知乎管理员 
												</div>
										    </div>
									  </div>
									</div> 
				      </a>
				</div>
			</div>
	</div>

		  <script>
		  // alert($);
		  // var email = $('#email').text();
		  //请求官方发送验证码
		  $('#svcode').click(function(){
		  	$.get('/people/send-code',{},function(date){
		  		alert(date);
		  	});

		  });
		  //发送用户填写的验证码
		  $('input[name=submit]').click(function(){
		  	var vcode = $('input[name=vcode]').val();
		  	// alert(vcode);
		  	//发送ajax
		  	// location.replace('/people/test-vcode');
		  	$.get('/people/test-vcode',{vcode:vcode},function(data){
		  		if(data==0){
		  		   alert('验证不正确');
		  		}else{
		  			document.write(data);
		  		}
		  		// alert(data.vcode);
		  	});//,"json"
		  });

		  



		  </script>



	
</body>
</html>